-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#133 code parser alternative #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like format_expression
doesn't make sense anymore. We rather need style_string_code
instead.
Hey @gogonzo this isn't working at all, I just pushed the code at the end of the day so it's secured by being send to a remote repository. It should be ready for testing today at the end of the day |
Hey @gogonzo and @chlebowa, an update for you!
And I'd like to incorporate few more feedback points from the other PR |
Co-authored-by: Aleksander Chlebowski <[email protected]> Signed-off-by: Marcin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I move that
- Only the generic constructor is mentioned in
usage
.
new_qenv
,eval_code
be documented in one file. Perhapsget_code
as well.
Also, since we do require the user to tag code lines, I wonder whether we should extend it to have them tag all lines and not try to find dependencies automatically.
Then we could simply
cc <- c("sp <- 'virginica' #@effect ii", "i <- iris #@effect ii", "ii <- subset(i, Species == sp) #@effect ii")
ex <- parse(text = cc)
lines <- attr(ex, "srcfile")$lines
# pseudo
l <- grep("@effect ii", lines, value = TRUE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails
q <- new_qenv()
q <- eval_code(q, expression({
a <- 1
b <- 2
}))
testthat::expect_identical(
get_code(q, names = "a"),
"a <- 1"
)
I think curly brackets should be removed either before inserting code to @code. Thanks to this trace in qenv.error
will have no brackets also.
Co-authored-by: Dawid Kałędkowski <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: Dawid Kałędkowski <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: Dawid Kałędkowski <[email protected]> Signed-off-by: Marcin <[email protected]>
Co-authored-by: Dawid Kałędkowski <[email protected]> Signed-off-by: Marcin <[email protected]>
It seems a |
Will have a look @chlebowa . You are good to go! |
I adapted |
- it is just a wrapper that works on a text or expression with srcref attributes - it is not included in get_code - it is separated from eval_code
…insightsengineering/teal.code into 133_code_parser_characters@main
Hey, we had a debate with @gogonzo on the final form of the current stage of code parser. @gogonzo would you mind taking a final look at the commit with recent changes that we discussed 193a52e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code_dependency covers cases which we desperately needed in teal. I accept this solution which can be now implemented on the refactor branch, where we can detect edge cases. Please merge to main once GH checks pass
Amazing, created a card for potential minor improvements that we can provide in the future #154 |
Code Coverage Summary
Diff against main
Results for commit: 864cc52 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Fixes #133
Alternative to #139